import time

from selenium.webdriver.common.by import By
from 测试.common.Utils import Driver

class List:
     url = ""
     driver = ""
     def __init__(self):
         self.driver = Driver.driver
         self.url = "http://127.0.0.1:9580/sign-in.html"
        # self.driver.get(self.url)
     def ListTest(self):
         #随便找几个元素检查一下意思意思
         self.driver.implicitly_wait(3)
         self.driver.find_element(By.CSS_SELECTOR,"body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > h1 > a > img")
         self.driver.find_element(By.CSS_SELECTOR,"#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post")
         # 点击头像

         self.driver.find_element(By.CSS_SELECTOR, "#index_nav_avatar").click()
         Driver.getScreenShot()

         # 点击帖子
         self.driver.find_element(By.CSS_SELECTOR,"#artical-items-body > div:nth-child(1) > div > div.col > div.text-truncate > a > strong").click()
         text=self.driver.find_element(By.CSS_SELECTOR,"#bit-forum-content > div.page-body > div > div > div:nth-child(2) > h3").text
         article="最新回复"
         assert(text==article)


         Driver.getScreenShot()

         self.driver.find_element(By.CSS_SELECTOR,"#nav_board_index > a").click()

         # # 点击分类
         self.driver.find_element(By.CSS_SELECTOR, "#topBoardList > li:nth-child(3)").click()

